<?php
class MW_Simplenews_Block_Bxslider extends Mage_Core_Block_Template 
{
	public function __construct(){
		parent::__construct();
		$news = $this->getNewslast();
		$this->setNews($news);
	}

	public function _prepareLayout(){
		return parent::_prepareLayout();
	}

	public function getNewslast(){
	 	$resource = Mage::getSingleton('core/resource');
	    /**
	     * Retrieve the read connection
	     */
	    $readConnection = $resource->getConnection('core_read');
	     
	    $query = 'SELECT * FROM ' . $resource->getTableName('simplenews/news').' ORDER BY news_id DESC LIMIT 3';
	     

	    $results = $readConnection->fetchAll($query);

	    return $results;
	}
}